<!DOCTYPE html>
<meta charset="UTF-8">

<table  style="width: 100%"  class="layui-table">
	<tr>
		<th>姓名</th>
		<th>联系电话</th>
		<th>书名</th>
		<th>借书时间</th>
		<th>还书时间</th>
		<th>是否违约</th>
		<th>操作</th>
	</tr>
	<tr th:each="f:${findAll}">
		<td th:text="${f.name}"></td>
		<td th:text="${f.phone}"></td>
		<td th:text="${f.title}"></td>
		<td th:text="${f.borrowData}"></td>
		<td th:text="${f.returnData}"></td>
		<td>违约</td>
		<td>
			<a href="#" th:onclick="'javascript:relieve(\''+${f.id}+'\')'" style="color: blue;">解封</a>
		</td>
	</tr>
</table>
<div style="text-align: center;" th:if="${findAll.size() == 0}">
	<h4>没有违约记录!</h4>
</div>
<script>
		function relieve(id){
			var f = confirm("解封期限为3天，联系读者立即还书,否则继续封锁！");
			if(f){
				$.ajax({
					type:'post',
					url:'userbook/relieve',
					data:{id:id},
					  success: function (data) {
						  alert(data); 
						  $("#body").load('userbook/breach');
					  }
				});
			}else{
				return false;
			}
		}
	</script>